#ifndef ONTOLOGY_CLASS
#define ONTOLOGY_CLASS

class Ontology {
public:
	Ontology();
	Ontology(FILE *fp);
	~Ontology();

	/* Static functions to create sorts: */ 
	Sort *get_sort(char *name);
	Sort *new_sort(char *name,char *super,int nfeatures,...);
	Sort *new_special_sort(char *name,char *super,int nfeatures,...);

	Sort *get_sort(Symbol *name);
	Sort *new_sort(Symbol *name,Sort *super,int nfeatures,...);
	Sort *new_special_sort(Symbol *name,Sort *super,int nfeatures,...);

	void delete_sort(Sort *s);

	bool load(FILE *fp);
	bool save(FILE *fp);

	Sort *get_random_sort(void);

	int get_nsorts(void);
	int get_sort_num(Sort *s);
	Sort *get_sort_num(int s);

	void set_name(char *name);
	void set_name(Symbol *name);

	void set_description(char *des);
	void set_description(Symbol *des);

private:

	Sort *get_sort_internal(char *name);
	Sort *get_sort_internal(Symbol *name);

	Symbol *m_name;			// ontology name
	Symbol *m_description;	// ontology description

	List<Sort> sort_list;
	List<Sort> undefined_sort_list;

	List<Sort> base_sorts;	/* These sorts are kept in a separate list, to identify them and not saving them when */ 
							/* the save() method is invoked */ 
};

#endif
